namespace DefaultNamespace
{
    public class PalindromeNum
    {
        public static  bool IsPalindrome(int x) 
        {
            if (x<0 || (x % 10 == 0 && x != 0))
            {
                return false;
            }
            int revertedNumber = 0;
            while(x > revertedNumber) {
                revertedNumber = revertedNumber * 10 + x % 10;
                x /= 10;
            }

            //x == revertedNumber/10;  这是中位数的情况
            
            return x == revertedNumber || x == revertedNumber/10;
        }
    }
}